package frontend.pages.admin.base;

import frontend.model.base.UIModel;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.util.string.StringValue;

import static frontend.pages.admin.base.AbstractManagingForm.PAGE_PARAMETER_KEY_OPERATION_SUCCESSFUL;

public abstract class AdminPanel<UIM extends UIModel> extends Panel {

    public AdminPanel(String id, PageParameters pageParameters) {
        super(id);
        if (pageParameters != null) {
            StringValue stringValue = pageParameters.get(PAGE_PARAMETER_KEY_OPERATION_SUCCESSFUL);
            if (!stringValue.isEmpty()) {
                info(stringValue);
            }
        }
    }
}
